
	@include('admin.head')
	<style type="text/css">

	.search-field
	{
		margin-bottom: -1px!important;
		margin-top: 1px!important;
		width: 20%!important;
	}
	</style>
	<div class="container">
		<div class="row">
			@include('admin.side')
			<div class="col-md-10" id="content-wrapper">
				<ul class="nav nav-tabs">
				  <li class="active"><a href="#project" data-toggle="tab" aria-expanded="false">融资项目</a></li>
				  <li class=""><a href="#device" data-toggle="tab" id="showDevice" aria-expanded="true">融资设备</a></li>
				  <li class=""><a href="#tech" data-toggle="tab" id="showTech" aria-expanded="true">融资技术</a></li>
				</ul>
				<div id="myTabContent" class="tab-content">
				 	<div class="tab-pane fade active in" id="project">
						<div class="row">
							<div class="col-xs-12">
								<div class=" clearfix">
									<div class="panel panel-default" id="base">
										<div class="panel-body">
											<table class="table user-list" id="all-project">
												<thead>
													<tr>
														<th data-column-id="id"><span>ID</span></th>
														<th data-column-id="name" data-sortable="false"><span>项目名称</span></th>
														<th data-column-id="description" data-formatter="description" data-sortable="false"><span>项目简介</span></th>
														<th data-column-id="investment_scale" data-sortable="false"><span>投资规模</span></th>
														<th data-column-id="address" data-sortable="false"><span>地区</span></th>
														<th data-column-id="is_financing"  data-formatter="financing" data-sortable="false"><span>融资状态</span></th>
														<th data-sortable="false" data-formatter="commands"><span>操作</span></th>
													</tr>
												</thead>
												<tbody>
												</tbody>
											</table>
										</div>
									</div>
								</div>
							</div>
						</div>
				  	</div>
				  	<div class="tab-pane fade" id="device">
				    	<div class="panel panel-default">
							<div class="panel-body">
								<table class="table user-list" id="all-devices">
									<thead>
										<tr>
											<th data-column-id="id"><span>ID</span></th>
											<th data-column-id="name" data-sortable="false"><span>设备名称</span></th>
											<th data-column-id="model" data-sortable="false"><span>设备型号</span></th>
											<th data-column-id="description" data-formatter="description" data-sortable="false"><span>设备描述</span></th>
											<th data-column-id="creator" data-sortable="false"><span>生产商</span></th>
											<th data-column-id="minimize_price" data-sortable="false"><span>设备最低价</span></th>
											<th data-column-id="maximize_price" data-sortable="false"><span>设备最高价</span></th>
											<th data-column-id="is_financing"  data-formatter="financing" data-sortable="false"><span>融资状态</span></th>
											<th data-sortable="false" data-formatter="commands"><span>操作</span></th>
										</tr>
									</thead>
									<tbody>
									</tbody>
								</table>
							</div>
						</div>
				  	</div>
				  	<div class="tab-pane fade" id="tech">
			    		<div class="panel panel-default">
				    		<div class="panel-body">
				    			<table class="table user-list" id="all-techs">
				    				<thead>
				    					<tr>
				    						<th data-column-id="id"><span>ID</span></th>
				    						<th data-column-id="tech_name" data-sortable="false"><span>技术名称</span></th>
				    						<th data-column-id="description" data-formatter="description" data-sortable="false"><span>技术描述</span></th>
				    						<th data-column-id="developer" data-sortable="false"><span>技术开发者</span></th>
				    						<th data-column-id="efficiency" data-sortable="false"><span>节能效益</span></th>
				    						<th data-column-id="is_financing"  data-formatter="financing" data-sortable="false"><span>融资状态</span></th>
				    						<th data-sortable="false" data-formatter="commands"><span>操作</span></th>
				    					</tr>
				    				</thead>
				    				<tbody>
				    				</tbody>
				    			</table>
				    		</div>
				    	</div>
				  	</div>
				</div>
			</div>
		</div>
	</div>
	@include("admin.footer")
	@include("admin.common")
</body>

<script type="text/javascript">

var labelsSetting = {
	infos: "当前第 {{ctx.start}} 条 到 {{ctx.end}} 条 共 {{ctx.total}} 条数据",
	search: "搜索",
	loading: "正在加载...",
	noResults: "未找到您要的数据...",
	refresh: "刷新",
	all: "全部"
};
$("#all-project").bootgrid({
	rowCount: [10, 25, 50],
    ajax:true,
    url: "finance/project_list",
    labels:labelsSetting,
    formatters: {
    	"commands": function(colume, row){
    		return '<a href="javascript:void(0);" fin_id="'+row.fin_id+'" class="table-link doEdit"><span class="fa-stack"><i class="fa fa-square fa-stack-2x"></i><i class="fa fa-pencil fa-stack-1x fa-inverse"></i></span></a>' + '<a href="javascript:void(0);" fin_id="'+row.fin_id+'" class="table-link doDetail"><span class="fa-stack"><i class="fa fa-square fa-stack-2x"></i><i class="fa fa-search-plus fa-stack-1x fa-inverse"></i></span></a>';
    	},
    	"financing":function(k, v){
    		if(v.is_financing == 1){
    			return "待审核";
    		}
    		if(v.is_financing == 2){
    			return "审核通过";
    		}
    		if(v.is_financing == 3){
    			return "审核未通过";
    		}
    	}
    }
}).on("loaded.rs.jquery.bootgrid", function (e) {
	$(".doEdit").bind('click', function (){
		var fin_id = $(this).attr('fin_id');
		window.location.href="finance/edit_finance?fin_id="+fin_id;
	});
	$(".doDetail").bind("click", function(){
		var fin_id = $(this).attr('fin_id');
		window.location.href="finance/detail_finance?fin_id="+fin_id;
	})
})

$("#all-devices").bootgrid({
	rowCount: [10, 25, 50],
    ajax:true,
    url: "finance/device_list",
    labels:labelsSetting,
    formatters: {
    	"commands": function(colume, row){
    		return '<a href="javascript:void(0);" pid="'+row.id+'" class="table-link doEdit"><span class="fa-stack"><i class="fa fa-square fa-stack-2x"></i><i class="fa fa-pencil fa-stack-1x fa-inverse"></i></span></a>' + '<a href="javascript:void(0);" pid="'+row.id+'" class="table-link doDetail"><span class="fa-stack"><i class="fa fa-square fa-stack-2x"></i><i class="fa fa-search-plus fa-stack-1x fa-inverse"></i></span></a>';
    	},
    	"financing":function(k, v){
    		if(v.is_financing == 1){
    			return "待审核";
    		}
    		if(v.is_financing == 2){
    			return "审核通过";
    		}
    		if(v.is_financing == 3){
    			return "审核未通过";
    		}
    	}
    }
}).on("loaded.rs.jquery.bootgrid", function (e) {
	$(".doEdit").bind('click', function (){
		var pid = $(this).attr('pid');
		window.location.href="project/edit_project?pid="+pid;
	});
	$(".doDetail").bind("click", function(){
		var pid = $(this).attr('pid');
		window.location.href="project/detail_project?pid="+pid;

$("#showDevice").click(function(){
	$("#all-devices").bootgrid({
		rowCount: [10, 25, 50],
	    ajax:true,
	    url: "finance/device_list",
	    labels:labelsSetting,
	    formatters: {
	    	"commands": function(colume, row){
	    		return '<a href="javascript:void(0);" fin_id="'+row.fin_id+'" class="table-link doEdit"><span class="fa-stack"><i class="fa fa-square fa-stack-2x"></i><i class="fa fa-pencil fa-stack-1x fa-inverse"></i></span></a>' + '<a href="javascript:void(0);" fin_id="'+row.fin_id+'" class="table-link doDetail"><span class="fa-stack"><i class="fa fa-square fa-stack-2x"></i><i class="fa fa-search-plus fa-stack-1x fa-inverse"></i></span></a>';
	    	},
	    	"financing":function(k, v){
	    		if(v.is_financing == 1){
	    			return "待审核";
	    		}
	    		if(v.is_financing == 2){
	    			return "审核通过";
	    		}
	    		if(v.is_financing == 3){
	    			return "审核未通过";
	    		}
	    	}
	    }
	}).on("loaded.rs.jquery.bootgrid", function (e) {
		$(".doEdit").bind('click', function (){
			var fin_id = $(this).attr('fin_id');
			window.location.href="finance/edit_finance?fin_id="+fin_id;
		});
		$(".doDetail").bind("click", function(){
			var fin_id = $(this).attr('fin_id');
			window.location.href="finance/detail_finance?fin_id="+fin_id;
		})

	})
})


$("#showTech").click(function(){
	$("#all-techs").bootgrid({
		rowCount: [10, 25, 50],
	    ajax:true,
	    url: "finance/tech_list",
	    labels:labelsSetting,
	    formatters: {
	    	"commands": function(colume, row){
	    		return '<a href="javascript:void(0);" fin_id="'+row.fin_id+'" class="table-link doEdit"><span class="fa-stack"><i class="fa fa-square fa-stack-2x"></i><i class="fa fa-pencil fa-stack-1x fa-inverse"></i></span></a>' + '<a href="javascript:void(0);" fin_id="'+row.fin_id+'" class="table-link doDetail"><span class="fa-stack"><i class="fa fa-square fa-stack-2x"></i><i class="fa fa-search-plus fa-stack-1x fa-inverse"></i></span></a>';
	    	},
	    	"financing":function(k, v){
	    		if(v.is_financing == 1){
	    			return "待审核";
	    		}
	    		if(v.is_financing == 2){
	    			return "审核通过";
	    		}
	    		if(v.is_financing == 3){
	    			return "审核未通过";
	    		}
	    	}
	    }
	}).on("loaded.rs.jquery.bootgrid", function (e) {
		$(".doEdit").bind('click', function (){
			var fin_id = $(this).attr('fin_id');
			window.location.href="finance/edit_finance?fin_id="+fin_id;
		});
		$(".doDetail").bind("click", function(){
			var fin_id = $(this).attr('fin_id');
			window.location.href="finance/detail_finance?fin_id="+fin_id;
		})
	})
})


//$("#all-admins-header").hide();

$(".btn-group").hide();

</script>

</html>